package com.ruoyi.experiment.domain;

import java.math.BigDecimal;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.experiment.model.TreeSample;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;

/**
 * 样品对象 sample
 *
 * @author ruoyi
 * @date 2024-05-29
 */
@Data
@EqualsAndHashCode(callSuper = false)
public class Sample extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 样品ID(自增) */
    private Long sampleId;

    private Long parentId;

    /** 项目ID */
    @Excel(name = "项目ID")
    private Long projectId;

    /** 样品名 */
    @Excel(name = "样品名")
    private String sampleName;

    /** 井号 */
    @Excel(name = "井号")
    private String wellId;

    /** 深度 */
    @Excel(name = "深度")
    private String depth;

    /** 岩石类型 */
    @Excel(name = "岩石类型")
    private String rockType;

    /** 样品量 */
    @Excel(name = "样品量")
    private String sampleQuantity;

    /** 样品尺寸 */
    @Excel(name = "样品尺寸")
    private String sampleSize;

    /** 样品备注 */
    @Excel(name = "样品备注")
    private String sampleBackup;

    /** 送样人 */
    @Excel(name = "送样人")
    private String sampleSender;

    /** 送样形式 */
    @Excel(name = "送样形式")
    private String sendingStyle;

    /** 送样日期 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "送样日期", width = 30, dateFormat = "yyyy-MM-dd")
    private Date deliveryDate;

    /** 联系方式 */
    @Excel(name = "联系方式")
    private String senderPhone;
    @Excel(name = "样品状态",readConverterExp = "-1=已退回,0=已入库,1=已申请,2=流转至实验管理员,3=流转至实验分发员,4=流转至项目负责人,5=新制备,6=已制备但未归还,7=已制备")
    private Integer sampleStatus;
    /** 样品图片 */
    private String sampleImage;

    private Integer currChildrenId;

    private Integer confirmStatus;
    @Excel(name = "批次/取样时间")
    private String batch;
    @Excel(name = "联系人")
    private String linkman;

    //该样品下实验数目
    private Integer expeNum;

    //已流转的实验数
    private Integer hasFlumExpeNum;

    //未添加的岗位数
    private Integer unAddPostNum;

    //未流转的岗位数
    private Integer noFlumPostNum;
    /** 实验相关数据  */
    @Excel(name = "实验类型")
    private String type;
    @Excel(name = "实验数量")
    private Long experimentNumber;
    @Excel(name = "实验单价，单位（分）")
    private Long experimentPrice;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "开始日期")
    private Date experimentDate;
    @Excel(name = "实验操作人")
    private String experimentPerson;
    @Excel(name = "实验备注")
    private String experimentRemark;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "结束日期")
    private Date experimentEndDate;
    //判断是否结题
    private Integer finish;
    private String job;
    private Long jobPrice;

    public Sample() {
    }

    public Sample(Long sampleId) {
        this.sampleId = sampleId;
    }

    public Sample(TreeSample treeSample){
        this.sampleId=treeSample.getSampleId();
        this.parentId= treeSample.getParentId();
        this.projectId= treeSample.getProjectId();
        this.sampleName= treeSample.getSampleName();
        this.wellId= treeSample.getWellId();
        this.depth= treeSample.getDepth();
        this.rockType= treeSample.getRockType();
        this.sampleQuantity= treeSample.getSampleQuantity();
        this.sampleSize= treeSample.getSampleSize();
        this.sampleBackup= treeSample.getSampleBackup();
        this.sampleSender= treeSample.getSampleSender();
        this.sendingStyle= treeSample.getSendingStyle();
        this.deliveryDate= treeSample.getDeliveryDate();
        this.senderPhone= treeSample.getSenderPhone();
        this.sampleStatus= treeSample.getSampleStatus();
        this.sampleImage= treeSample.getSampleImage();
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
                .append("sampleId", getSampleId())
                .append("projectId", getProjectId())
                .append("sampleName", getSampleName())
                .append("wellId", getWellId())
                .append("depth", getDepth())
                .append("rockType", getRockType())
                .append("sampleQuantity", getSampleQuantity())
                .append("sampleSize", getSampleSize())
                .append("sampleBackup", getSampleBackup())
                .append("sampleSender", getSampleSender())
                .append("sendingStyle", getSendingStyle())
                .append("deliveryDate", getDeliveryDate())
                .append("senderPhone", getSenderPhone())
                .append("sampleStatus", getSampleStatus())
                .append("parentId",getParentId())
                .toString();
    }
}

